FROM docker-mirror.aigc2d.com/python:3.8-slim

WORKDIR /app
COPY . /app
COPY requirements.txt /app/

#RUN echo "https://mirrors.aliyun.com/alpine/v3.12/main" > /etc/apk/repositories && \
#    echo "https://mirrors.aliyun.com/alpine/v3.12/community" >> /etc/apk/repositories && \
#    apk update && \
#    apk add --no-cache gcc musl-dev linux-headers libc6-compat

RUN set -ex \
    && echo "Starting pip configuration..." \
    && pip install --upgrade pip setuptools wheel \
    && pip config set global.index-url https://mirrors.aliyun.com/pypi/simple \
    && echo "Installing Python dependencies..." \
    && pip install --no-cache-dir -r /app/requirements.txt -vvv

EXPOSE 5000

CMD ["gunicorn", "--workers", "3", "--bind", "0.0.0.0:5000", "app:app"]
